﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="get_examp.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Lesson.get_examp" %>
<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <%--<textarea rows="4" id="lesson_examp" class="w3-half" placeholder="Nhập bài tập"><%=this.examp %></textarea>--%>
    <%
        int id = int.Parse(Request.QueryString["id"]);
        var get_exam = new TblLessonExamController().FetchAll().Where(x => x.ExamActive == true && x.LessonId == id);
    %>
    <ul class="w3-navbar w3-black">
        <div id="exam_name_area">
            <%
                foreach (TblLessonExam exam in get_exam)
                {
            %>
            <li class="exam<%=exam.ExamId %>"><a class="exam_name w3-hide"><%=exam.ExamName %></a><a href="javascript:;" class="examlink" ondblclick="editExam('<%=exam.ExamId %>')" onclick="openexam(event, 'exam<%=exam.ExamId %>');"><%=exam.ExamName %>&nbsp;<i onclick="deleteExam(<%=exam.ExamId %>)" title="Xóa" class="fa fa-times w3-hover-white"></i></a></li>
            <%} %>
        </div>
        <li><a title="Thêm mới" href="javascript:;" onclick="addExam();"><i class="fa fa-plus"></i></a></li>
    </ul>
    <%
        foreach (TblLessonExam exam in get_exam)
        {
         %>
    <div id="exam<%=exam.ExamId %>" class="hoithoai w3-padding w3-border exampart" style="display: none">
        <div class="w3-hide exam_id"><%=exam.ExamId %></div>
        <textarea id="exam_content_<%=exam.ExamId %>" class="listen_content"><%=exam.ExamQuestion %></textarea>
        <ul class="w3-ul">
            <li>
                <div class="w3-row">
                    <a class="w3-text-red">Đáp án</a><br />
                    <div class="themvidu w3-threequarter">
                        <textarea id="exam_result_<%=exam.ExamId %>" class="listen_result"><%=exam.ExamResult %></textarea>
                    </div>
                </div>
            </li>
        </ul>
        <div class="w3-row w3-center w3-padding">
            <a class="w3-btn w3-green btn_edit_exam"><i class="fa fa-save"></i>&nbsp;Lưu chỉnh sửa</a>
        </div>
    </div>
    <%} %>
</body>
</html>
